﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.Paint.DefinePaintBrush.CCoCDefineBrushCmd
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System.Collections.ObjectModel;
using System.Windows;
using Tecnomatix.Engineering;
using Tecnomatix.Engineering.Ui;
using Tecnomatix.Engineering.Ui.WPF;


namespace DnProcessSimulateCommands.Paint.DefinePaintBrush;

public class CCoCDefineBrushCmd : TxButtonCommand
{
  private ITxCommandEnabler _enabler;
  private TxWindow _brushDefinitionWindow;

  public CCoCDefineBrushCmd()
  {
    this._enabler = (ITxCommandEnabler) new CCoCDefineBrushCmdEnabler();
  }

  public virtual ITxCommandEnabler CommandEnabler => this._enabler;

  public virtual string Bitmap => "Paint.DefinePaintBrush.Resources.DefineBrush.bmp";

  public virtual string LargeBitmap => "Paint.DefinePaintBrush.Resources.DefineBrush_BIG.png";

  public virtual string Name => DnProcessSimulateCommands.Paint.DefinePaintBrush.Resources.StringTable.DEFINE_BRUSH_CMD_NAME;

  public virtual string Category => DnProcessSimulateCommands.Paint.DefinePaintBrush.Resources.StringTable.DEFINE_BRUSH_CMD_CATEGORY;

  public virtual string Description => DnProcessSimulateCommands.Paint.DefinePaintBrush.Resources.StringTable.DEFINE_BRUSH_CMD_DESCRIPTION;

  public virtual string Tooltip => DnProcessSimulateCommands.Paint.DefinePaintBrush.Resources.StringTable.DEFINE_BRUSH_CMD_TOOLTIP;

  public virtual bool Licensed => TxCommandLicenser.PaintBrushEditorLicense;

  public virtual ITxImage Image => (ITxImage) TxImageManager.GetImageByKey("PaintBrushEditor");

  public virtual void Execute(object cmdParams)
  {
    if (!this._enabler.Enable)
      return;
    TxObjectList items = TxApplication.ActiveSelection.GetItems();
    if (((Collection<ITxObject>) items).Count != 1 || !(((Collection<ITxObject>) items)[0] is ITxRobot))
      return;
    this._brushDefinitionWindow = (TxWindow) new CUiDefineBrushesWindow();
    ((Window) this._brushDefinitionWindow).Show();
  }
}
